package tushare

import (
	"tushare/model/mysql"
)

type ReferenceSubstance struct {
	Id        int64   `json:"id"`
	TsCode    string  `json:"ts_code"`
	FirstLow  float64 `json:"first_low"`
	SecondLow float64 `json:"second_low"`
}

func ReferenceSubstanceCreate(rs ReferenceSubstance) {
	mysql.DB.Table("tushare_reference_substance").Create(&rs)
}

func FiveDayAvgUpdate(tsCode string, fiveDayAvg float64) {
	mysql.DB.Table("tushare_reference_substance").Where("ts_code = ?", tsCode).Update("five_day_avg", fiveDayAvg)
}
